package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.model.dto.building.BuildingQueryRequest;
import com.cyy.springbootinit.model.entity.Building;
import com.cyy.springbootinit.model.vo.BuildingVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 楼宇服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface BuildingService extends IService<Building> {

    /**
     * 校验数据
     *
     * @param building
     * @param add 对创建的数据进行校验
     */
    void validBuilding(Building building, boolean add);

    /**
     * 获取查询条件
     *
     * @param buildingQueryRequest
     * @return
     */
    QueryWrapper<Building> getQueryWrapper(BuildingQueryRequest buildingQueryRequest);
    
    /**
     * 获取楼宇封装
     *
     * @param building
     * @param request
     * @return
     */
    BuildingVO getBuildingVO(Building building, HttpServletRequest request);

    /**
     * 分页获取楼宇封装
     *
     * @param buildingPage
     * @param request
     * @return
     */
    Page<BuildingVO> getBuildingVOPage(Page<Building> buildingPage, HttpServletRequest request);
}
